using Game.Main.Model;
using Game.XH;
using UnityEngine;

namespace Game.Component
{
	public class BMachineDisplayerItem : BaseItem
	{
		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
		}

		public void ShowDisplayer(CharacterItem item)
		{
			Transform transform = model.Find("Displayer");
			if (item == null)
			{
				transform.SetObjectActive(false);
				return;
			}
			transform.SetObjectActive(true);
			int topsId = item.GetTopsId();
			int num = 2;
			if (topsId > 4 && topsId < 12)
			{
				num = Random.Range(0, 2);
			}
			int childCount = transform.childCount;
			for (int i = 0; i < childCount; i++)
			{
				if (i == num)
				{
					transform.GetChild(i).gameObject.SetActive(true);
				}
				else
				{
					transform.GetChild(i).gameObject.SetActive(false);
				}
			}
		}
	}
}
